<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>具名插槽</title>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
    <div id="app">
        <computer>
            <div slot="CPU">Intel Core i7</div>
            <div slot="GPU">GTX980Ti</div>
            <div slot="Memory">Kingdton 128G</div>
            <div slot="Hard-drive">Samsung SSD 1T</div>
        </computer>
    </div>
    <template id="computer">
       <div>
           <slot name="CPU">这儿插CUP</slot>
           <slot name="GPU">这儿插显卡</slot>
           <slot name="Memory">这儿插内存</slot>
           <slot name="Hard-drive">这儿插硬盘</slot>
       </div>
    </template>
</body>
<script type="text/javascript">
var vm=new Vue({
    el:"#app",
    data:{

    },
    components:{
        "computer":{
            template:"#computer"
        }
    }
});
</script>
</html>